package com.bjwl.wybx.mapper;

import com.bjwl.wybx.entity.Notice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface NoticeMapper {
    //添加公告
    @Insert("insert into notice values(default,#{ro_id},#{notice_desc})")
    int add(Notice notice);
    //删除公告
    @Delete("delete from notice where notice_id=#{notice_id}")
    int delete(Integer notice_id);
    //修改公告
    @Update("update notice set ro_id=#{ro_id},notice_desc=#{notice_desc} where notice_id=#{notice_id}")
    int update(Notice notice);
    //查询所有公告
    @Select("select * from notice")
    List<Notice> query();
    //根据角色查询相对应的公告
    @Select("select * from notice where ro_id=#{ro_id}")
    List<Notice> queryByRoId(Integer ro_id);
    //查询某一条公告
    @Select("select * from notice where notice_id=#{notice_id}")
    Notice queryOne(Integer notice_id);
<<<<<<< HEAD

    @Select("select * from notice")
    List<Notice> getNoticeDataList();
=======
>>>>>>> 70f7e19d6da4b30f0412d394b1171a015e63af36
}
